package ru.payment.wm.impl;

import org.dom4j.Element;
import ru.payment.wm.UserInfoRow;

/**
 *
 * User: sergey
 * Date: 23.04.2009
 * Time: 19:16:33
 *
 */
public class UserInfoRowParser extends AbstractResponseParser<UserInfoRow, Element> {

  public void parse(Element e, UserInfoRow info) throws ProtocolException {
    if (e == null) {
      return;
    }

    info.setCtype(attrAsString(e.attribute("ctype"), ""));
    info.setJuridicalStatus(attrAsString(e.attribute("jstatus"), ""));
    info.setOsnovaInfo(attrAsString(e.attribute("osnovainfo"), ""));
    info.setLocked(attrAsString(e.attribute("locked"), ""));
    info.setNickName(attrAsString(e.attribute("nickname"), ""));
    info.setExtraInfo(attrAsString(e.attribute("infoopen"), ""));
    info.setCity(attrAsString(e.attribute("city"), ""));
    info.setCountry(attrAsString(e.attribute("country"), ""));
    info.setZipCode(attrAsString(e.attribute("zipcode"), ""));
    info.setAddress(attrAsString(e.attribute("adres"), ""));
    info.setLastName(attrAsString(e.attribute("fname"), ""));
    info.setFirstName(attrAsString(e.attribute("iname"), ""));
    info.setMiddleName(attrAsString(e.attribute("oname"), ""));
    info.setPassportNumber(attrAsString(e.attribute("pnomer"), ""));
    info.setPassportDate(attrAsString(e.attribute("pdate"), ""));
    info.setPassportCountry(attrAsString(e.attribute("pcountry"), ""));
    info.setPassportCity(attrAsString(e.attribute("pcity"), ""));
    info.setPasportByWhom(attrAsString(e.attribute("pbywhom"), ""));
    info.setRegistrationCountry(attrAsString(e.attribute("rcountry"), ""));
    info.setRegistrationCity(attrAsString(e.attribute("rcity"), ""));
    info.setRegistrationAddress(attrAsString(e.attribute("radres"), ""));
    info.setBirthdayPlace(attrAsString(e.attribute("bplace"), ""));
    info.setBirthdayDay(attrAsString(e.attribute("bday"), ""));
    info.setBirthdayMonth(attrAsString(e.attribute("bmonth"), ""));
    info.setBirthdayYear(attrAsString(e.attribute("byear"), ""));
    info.setCompanyName(attrAsString(e.attribute("name"), ""));
    info.setCompanyDirFio(attrAsString(e.attribute("dirfio"), ""));
    info.setCompanyBuhFio(attrAsString(e.attribute("buhfio"), ""));
    info.setInn(attrAsString(e.attribute("inn"), ""));
    info.setOkpo(attrAsString(e.attribute("okpo"), ""));
    info.setOkonx(attrAsString(e.attribute("okonx"), ""));
    info.setCompanyAddress(attrAsString(e.attribute("jadres"), ""));
    info.setCompanyCountry(attrAsString(e.attribute("jcountry"), ""));
    info.setCompanyCity(attrAsString(e.attribute("jcity"), ""));
    info.setCompanyZipCode(attrAsString(e.attribute("jzipcode"), ""));
    info.setCompanyBankName(attrAsString(e.attribute("bankname"), ""));
    info.setBik(attrAsString(e.attribute("bik"), ""));
    info.setKorrs(attrAsString(e.attribute("ks"), ""));
    info.setRs(attrAsString(e.attribute("rs"), ""));
    info.setHomePhone(attrAsString(e.attribute("phonehome"), ""));
    info.setMobilePhone(attrAsString(e.attribute("phonemobile"), ""));
    info.setIcq(attrAsString(e.attribute("icq"), ""));
    info.setFax(attrAsString(e.attribute("fax"), ""));
    info.setEmail(attrAsString(e.attribute("email"), ""));
    info.setWeb(attrAsString(e.attribute("web"), ""));
    info.setContactPhone(attrAsString(e.attribute("phone"), ""));
    info.setCapOwnerWmId(attrAsString(e.attribute("cap_owner"), ""));
    info.setPassportChecked(attrAsString(e.attribute("pasdoc"), ""));
    info.setInnChecked(attrAsString(e.attribute("inndoc"), ""));
  }

}
